import { UNMOUNTING,MOUNTED, NOT_MOUNTED } from "../applications/app.helper";

export async function toUnmountPromise(app) {
    // 如果当前应用没有被挂载 则不做处理
    if (app.status != MOUNTED) {
        return app;
    }
    app.status = UNMOUNTING;
    await app.unmount(app.customProps);
    app.status = NOT_MOUNTED;
    return app;
}